package com.mcxx.handler;

import com.mcxx.result.BaseResult;

import java.util.Map;


public abstract class BizProcessHandler {

    abstract protected BaseResult preProccess(Map<String, Object> params);

    abstract protected BaseResult doProcess(Map<String, Object> params);


    public BaseResult processHandle(Map<String, Object> params) {
        BaseResult result = preProccess(params);
        params.put("result",result);
        if (result.isSuccess()) {
            return doProcess(params);
        }
        return result;
    }
}
